<h1 mat-dialog-title>{{ helptext.selectPreset | translate }}</h1>
<div mat-dialog-content>
  <p>{{ helptext.selectPresetTooltip | translate }}</p>

  @if (!data.allowCustom) {
    <p [innerHTML]="helptext.message | translate"></p>
  }

  <form [formGroup]="form">
    @if (data.allowCustom) {
      <ix-radio-group
        formControlName="usePreset"
        [options]="usePresetOptions$"
      ></ix-radio-group>
    }
    <!-- TODO: Add [required]="true" once FormsModule is removed -->
    @if (form.value.usePreset) {
      <ix-select
        formControlName="presetName"
        [label]="'Preset' | translate"
        [options]="presetOptions$"
      ></ix-select>
    }
  </form>

  <ix-form-actions>
    <button mat-button matDialogClose ixTest="cancel">{{ 'Cancel' | translate }}</button>
    <button
      mat-button
      color="primary"
      matDialogClose
      ixTest="continue"
      [disabled]="form.invalid"
      (click)="onContinuePressed()"
    >
      {{ 'Continue' | translate }}
    </button>
  </ix-form-actions>
</div>
